<div id="network-bar2" style="height: 100%">

</div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "#springUrl('/network/bar2')",
            data: {"batchId": "$!{batchId}"},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var myChart = echarts.init(document.getElementById('network-bar2'), 'macarons');
                    var option = {
                        title: {
                            text: '配送中心成本分布',
                            show: false
                        },
                        color: ['#3398DB'],

                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        xAxis: [
                            {
                                type: 'category',
                                data: d.data.name,
                                axisTick: {
                                    alignWithLabel: true
                                }
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                splitLine:{
                                    show:false
                                },
                                splitArea: {
                                    show: true,
                                    areaStyle: {
                                        color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                                    }
                                },
                            }
                        ], grid: {
                            top: 20,
                            left: 15,
                            right: 15,
                            bottom: 5,
                            containLabel: true
                        },
                        series: [
                            {
                                name: '配送中心成本分布',
                                type: 'bar',
                                barWidth: '60%',
                                data: d.data.value,
                            }
                        ]
                    };
                    myChart.setOption(option);
                }
            }
        });
    });
</script>